//
//  BulletCache.h
//  MyTest1
//
//  Created by 祥 雍 on 12-3-13.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "cocos2d.h"
#import "Bullet.h"

@interface BulletCache : CCNode
{
    CCSpriteBatchNode* batch;
    NSMutableDictionary* bulletsDict;
    int nextInactiveBullet;
}

-(void) preBuildBulletWithId:(int)bulletId
                      number:(int)number;
-(void) shootBulletAt:(CGPoint)startPosition
             rotation:(float)rotation
                speed:(float)speed
                range:(float)range
           damageType:(int)damageType
          damageValue:(float)damageValue
             bulletId:(int)bulletId
               isTeam:(BOOL)isTeam;

-(BOOL) isPlayerBulletCollidingWithRect:(CGRect)rect;
-(BOOL) isEnemyBulletCollidingWithRect:(CGRect)rect;
-(BOOL) isBulletCollidingWithRect:(CGRect)rect 
                           isTeam:(BOOL)isTeam;
@end
